#!/bin/csh 
#.................................................................................................

setenv NCARG_ROOT  /Users/zhan524/tools/ncl_ncarg-6.0.0.MacOS_10.6_64bit_nodap_gcc421 
setenv NCARG_ROOT  /share/apps/ncl/6.0.0/gnu

setenv makeplot "T" 
setenv plotform "pdf" 
setenv plotview "png" 


if ($makeplot == "T") then 

echo OK 


#.................................................................................................

cat > load_setup.ncl << EOF

  plotfmt = "$plotform"
  shortname = "presc_piice_pddust_pdcont_maxvw3_X0008A-X0008B_0003-0007" 

  ca = "X0008B"
  cb = "X0008A"

  na = "X0008B"  ;;"presc BN fixdust PI" 
  nb = "X0008A"  ;;"presc BN fixdust PD" 

  basepa = "/pic/scratch/zhan524/"
  basepb = "/pic/scratch/zhan524/"

  ma = ".cam2.h0.0003-0007.ANN.nc" 
  mb = ".cam2.h0.0003-0007.ANN.nc" 

EOF


foreach exe (*.ncl)
   echo ncl $exe
   ncl $exe
end

endif

#.................................................................................................
# convert to other format 
#.................................................................................................
 
if($plotform == "eps") then
if($plotview == "png") then
   foreach ff (*.eps)
      echo $ff.png
      convert -density 200 $ff $ff.png
   end
endif
endif

mv -f *.png plot_png 
mv -f *.eps plot_eps 
mv -f *.pdf plot_pdf



